# @Filename:    sample1
# @Author:      王佳伟
# @Time:        2025-02-25 16:56
# @Describe:    页面截图
from selenium import webdriver


def take_screenshot(url, file_path):
    driver = webdriver.Chrome()
    driver.get(url)
    driver.save_screenshot(file_path)
    driver.quit()


if __name__ == '__main__':
    take_screenshot('https://www.baidu.com', 'screenshot.png')
